package com.qmo.edu.mvp.presenter;

import com.qmo.edu.base.BasePresenter;
import com.qmo.edu.base.ProgressObserver;
import com.qmo.edu.base.RxSchedulers;
import com.qmo.edu.mvp.view.ForgetPwdView;

import java.util.Map;

/**
 * Created by ${} on 2019/6/2/002.
 *
 * @author cyx
 */
public class ForgetPwdPresenter extends BasePresenter<ForgetPwdView> {

    public void getCode(Map<String, String> map) {
//        mApiService.getcode(map)
//                .compose(RxSchedulers.observableIO2Main(getView()))
//                .compose(getView().bindLifeycle())
//                .subscribe(new ProgressObserver<BaseResponse>(this) {
//                    @Override
//                    public void onSuccess(BaseResponse result) {
//                        getView().onGetCode();
//                    }
//                });

    }

    public void updatePwd(String token,Map<String, String> map) {
        mApiService.updatePwd(token,map)
                .compose(RxSchedulers.observableIO2Main(getView()))
                .compose(getView().bindLifeycle())
                .subscribe(new ProgressObserver<String>(this) {
                    @Override
                    public void onSuccess(String result) {
                        getView().onUpdatePwd(result);
                    }
                });
    }
}
